import { jsx as _jsx } from "react/jsx-runtime";
import React from "react";
import TextBox from "devextreme-react/text-box";
import { throttle } from "../../../tools/Tools";
class DevGridSearchIpt extends React.Component {
    constructor(props) {
        super(props);
        this.getInputValue = this.getInputValue.bind(this);
        this.inputSearch = this.inputSearch.bind(this);
    }
    inputSearch(content) {
        const ref = this.props?.devGridRefs;
        if (ref) {
            console.log(content);
            ref.searchByTextGridData(content || "");
        }
        else {
            console.log("获取devGridRefs属性失败。");
        }
    }
    throttleSearch = throttle(this.inputSearch, 100);
    getInputValue(e) {
        const { event } = e;
        this.throttleSearch(event.target.value);
    }
    componentWillUnmount() {
        console.log("卸载事件");
        console.log("卸载throttleSearch");
        this.throttleSearch();
    }
    render() {
        return _jsx(TextBox, { ...this.props, onInput: (e) => this.getInputValue(e) });
    }
}
export default DevGridSearchIpt;
